var express = require("express")
var router = express.Router()
var admin = require("../models/admin")

router.route("/query").post((req, res) => {
    admin.findOne(
    {
      aname: req.body.aname,
      apwd: req.body.apwd,
    },
    (err, data) => {
      if (err) {
        console.log(err)
        return
      }
      res.json({
        code: "200",
        data: data,
      })
      console.log(JSON.stringify(data))
    }
  )
})
module.exports = router